Help:Adding New Treasures
Tutorial This is a tutorial on adding new Treasures for use with various automatic Templates, such as Template:TreasureList and Template:AutoTreasure. If you have a new treasure to add, or if you need to modify existing information on a treasure, this is the place to be! The Basics Adding a treasure anywhere on this wiki is fairly simple. If you want, you can just make tables and fill them up with pictures and information you upload to the site. But if you really want to make an impression with other users, be sure to use some of the templates available to you so your article looks good, stays looking good, and displays just like all the other articles. The Templates Here is a list of some of the treasure templates you may find useful: Treasure List The treasure list template allows the user to enter in a list of treasures (up to 20) and display them in a nice graphical way. This template calls on another template, AutoTreasure. Here is an example using some blank sample collections. AutoTreasure The autotreasure template will display a single treasure set in the same graphical way as the treasure list template. All you have to do is supply the treasure set name. This template calls on another template, FxTreasureSet to actually display the treasure graphically. Here is an example using the blank sample collection again. In addition to the default Line output, you may also specify Block in the display parameter. FxTreasureSet This is the actual function that displays the treasure set (actually it has two sub functions as well, but they need no more than a mention). If for some reason you dont want to get the treasure set information automatically, you can fill in the FxTreasureSet template by adding it to an article and then editing it with the "Source" button. It takes a lot of information, and a partially filled in template can look terrible. For that reason, no example will be shown here. Know that output is exactly the same as AutoTreasure above. The Databases All information used by the previous templates is stored in other templates and retrieved using the "Switch" function. These lists are fairly long because the list of Treasures and Items just keeps getting longer. Here is a summary of the databases you will want to edit if you need to add or make changes to a treasure set: Collection Data Collection data is stored in the Template:GetCollectionData. Each line represents another treasure set. Here is an example: |Shark Proof=group atlantis%rarity Very Rare%reward 10000 Coins%xp 30%collectables Gloves,Sleeves,Shirt,Hood,Shoes The example shown displays the line that represents the Shark Proof treasure set. If a user types in , the return value would be: It looks like a long chunk of information, but it is nicely divisible at each (%) symbol, just like a web page separates parameters in the command line by its (&) symbols. In addition, the section containing its collectables can be broken apart at each comma. To get the information from a database line, the templates described above rely on the templates Template:GetParameter and Template:GetSubParameter. If you need to add a new treasure set to the database, just copy a line and add it to the bottom, then change the information in that line. It is really quite simple, but if you make a mistake, it could destroy the functionality for all auto treasure templates on this entire wiki. So make sure you always use preview mode before you publish. In addition, have an article open in another window or tab that relies on this database so you can immediately test its function after you click publish. If you break it, contact the nearest active Admin immediately. Collectible Descriptions Collectible descriptions or "tooltips" are stored in another database similar to the above. See Template:GetTDesc for the list of descriptions for individual treasure set items. Any time you add a treasure set to this wiki, you should make an effort to add the set item descriptions to the database. The structure is simple: *Add a new line using "|", *Type the collectible name (spelled exactly as it will be called by functions) *Type "=" *Type the description you want to display (this should be the description from the game found in the collections menu) If you do this right, all the auto treasure templates will be able to display tooltips when you put your mouse over the individual collectibles. Again, if you break it contact the nearest active Admin immediately. Further Reading If you havent already, you should take a look at the following templates: *Template:TreasureList: Displays a list of treasure sets in a graphical format *Template:AutoTreasure: Displays a single treasure set in a graphical format *Template:FxTreasureSet: Manually enter a single treasure set so it displays in a graphical format *Template:GetCollectionData: Database where collection information is stored *Template:GetTDesc: Database where collectible item information is stored *Template:GetParameter: Splits a line of data at all (%) symbols and returns a value by its parameter name. *Template:GetSubParameter: Splits a line of data at all (%) symbols, then splits the requested parameter's value at all (,) marks, and then returns the index requested from that array. *Template:Eq: Returns the equals (=) symbol, for use where you cant just use (=), like in some parser functions. This was used in each line of data found in Template:GetCollectionData to prevent errors. You might also want to see: * : A tutorial on adding new maps to this wiki, which uses the templates described in this article. *Maps: The most likely location to start looking for these templates in action. Look in the individual maps! *Template:AutoTreasuresByMap: Another template in testing that automatically builds a list of collections (like the manual Template:TreasureList) just by passing the map name. * : An article on the development and use of the AutoTreasure template series.